<?php defined('KX_ROOT') || exit('Permission denied');?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <title>充值 - <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></title>
    <link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/css/global.css"/>
    <script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/js/flexible.min.js"></script>
</head>
<body>
<div class="w100">
    <div class="w100  bg-white flex-wrp flex-align-center flex-between lh100 plr15 ptb15">
        <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/images/return.png" class="pt-return">
        <div class="size18 bold color37">充值</div>
        <div>
            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/images/ellipsis.png" class="mr5 pt-ellipsis">
        </div>
        <div class="pt5 pb5 pt-tip">
            <a href="<?php echo \Kuxin\Helper\Url::build("index.index",[],"");?>" class="block color1 text-center pt-tip-item" title="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?>">前往首页</a>
            <a href="<?php echo \Kuxin\Helper\Url::build("novel.search.index",[],"");?>" class="block color1 text-center pt-tip-item">搜索小说</a>
        </div>
    </div>

    <div class="bg-white bold pl20 ptb20 mb10">
        <span>充值账号</span>
        <span class="fr color32 mr20"><?php echo $userinfo['name'];?></span>
    </div>

    <div class="bg-white mb10 pt-list pt-pay-platform">
        <div class="flex-wrp flex-align-center mb20" data-platform="2">
            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/images/wx.png" class="mr10" style="height: .22rem;width:.22rem">
            <span class="size14 lh100 color7">微信</span>
        </div>
        <div class="flex-wrp flex-align-center active" data-platform="1">
            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/images/alipay.png" class="mr10" style="height: .22rem;width:.22rem">
            <span class="size14 lh100 color7">支付宝</span>
        </div>
    </div>
    <div class="bg-white mb10 pt-list pt-pay-list">
        <div class="flex-wrp flex-align-center">
            <img src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/images/wx.png" class="mr10" style="height: .22rem;width:.22rem">
            <span class="size14 lh100 color7">我的书架</span>
        </div>
        <ul style="padding: .1rem;">
            <?php if(is_array(\Kuxin\Helper\Arr::getValue($_kxcms_config, "recharge.list")) && (array()!=\Kuxin\Helper\Arr::getValue($_kxcms_config, "recharge.list"))): $i=array(); $i['loop']=array_slice(\Kuxin\Helper\Arr::getValue($_kxcms_config, "recharge.list"),0,null,true); $i['total']=count(\Kuxin\Helper\Arr::getValue($_kxcms_config, "recharge.list")); $i['count']=count($i['loop']); $i['cols']=1; $i['add']=$i['count']%1?1-$i['count']%1:0; $i['order']=0; $i['row']=1;$i['col']=0;foreach(array_pad($i['loop'],$i['add'],array()) as $i['index']=>$i['list']): $loop=$i['list']; $i['order']++; $i['col']++; if($i['col']==1): $i['col']=0; $i['row']++; endif; $i['first']=$i['order']==1; $i['last']=$i['order']==$i['count']; $i['extra']=$i['order']>$i['count'];?>
            <li class="ptb10">
                <input type="radio" id="money_list_<?php echo $loop;?>" name="money_list" value="<?php echo $loop;?>">
                <label for="money_list_<?php echo $loop;?>">
                    <span class="inline-block size20 color32 bold mr20" style="border-right: 1px solid #858585;width: 1rem">
                    <?php echo $loop * \Kuxin\Helper\Arr::getValue($_kxcms_config, "recharge.ratio");?><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.money_caption");?>
                    </span>
                    &yen;<span><?php echo $loop;?></span>
                </label>
            </li>
            <?php endforeach; endif;?>
            <li class="ptb10">
                <input type="radio" id="money_list_other" name="money_list" value="0">
                <label for="money_list_other">
                    <span class="inline-block size20 color32 bold mr20" style="border-right: 1px solid #858585;width: 1rem">自定金额</span>
                    <input type="number" id="money_other" placeholder="请输入自定义金额">
                </label>
            </li>
        </ul>
    </div>
    <div class="mb10 pt-list pt-pay-bottom">
        <button class="pt-login-btn color1" style="width:90vw;">立即支付</button>
        <div class="text-center color32 size14 mt10">
            <input type="checkbox" id="read_and_agree" checked="checked">
            <label for="read_and_agree">我同意<span class="color2">《用户服务协议》</span></label>
        </div>
    </div>
</div>

<!-- 底部版权 -->
<div class="pt-copyright">
    <div class="size12  w100 text-center mt15 mb10"><a title="隐私声明" href="<?php echo \Kuxin\Helper\Url::build("page.detail",['key'=>'privacy'],"");?>" class="color4">隐私声明</a> | <a title="免责声明" href="<?php echo \Kuxin\Helper\Url::build("page.detail",['key'=>'disdaimer'],"");?>" class="color4">免责声明</a> | <a title="关于我们" href="<?php echo \Kuxin\Helper\Url::build("page.detail",['key'=>'about'],"");?>" class="color4">关于我们</a></div>
    <div class="size12 color4 w100 text-center mb10">Copyright © 2009-<?php echo date(Y);?> <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "beian");?></div>
    <div class="size12  w100 text-center"><?php echo \Kuxin\Response::runinfo();?></div>
</div>
<!-- js -->
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxmobileno1/js/jquery-3.3.1.js"></script>
<script>
    $('.pt-return,.pt-recall').click(function(){
        window.history.back();
    });
    $('.pt-ellipsis').click(function(){
        $('.pt-tip').toggle()
    });
    $('.pt-tip .pt-tip-item').click(function(){
        $('.pt-tip').toggle()
    });
</script>
<div class="none">
    <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "tongji.mobile");?>
    <?php if(\Kuxin\Helper\Arr::getValue($_kxcms_config, "app.use_cdn")):?>
    <script src="/api/stat/novel/info.js"></script>
    <script src="/api/stat/novel/read.js"></script>
    <?php endif;?>
</div>
<script>
    $('.pt-pay-platform .flex-align-center').click(function () {
        $('.pt-pay-list .flex-align-center img').attr('src', $(this).find('img').attr('src'));
        $('.pt-pay-list .flex-align-center span').text($(this).find('span').text());
        $('.pt-pay-list .flex-align-center').data('platform', $(this).data('platform'));
        $('.pt-pay-list').show();
        $('.pt-pay-bottom').show();
        $(this).parent().hide()
    });
    $('#money_other').click(function () {
        $('#money_list_other').prop('checked',true)
    }).change(function () {
        $('#money_list_other').val($(this).val());
    });
    $('#money_list_other').change(function () {
        $('#money_other').focus();
    });
    $('.pt-pay-bottom button').click(function () {
        if(!$('#read_and_agree').prop('checked')){
            return alert('请先阅读并同意协议');
        }
        var platform = $('.pt-pay-list .flex-align-center').data('platform'), price = parseFloat($('input[name=money_list]:checked').val());

        if (price > 0) {
            window.location.href = '<?php echo \Kuxin\Helper\Url::build("user.pay.unifiedorder",['method'=>1,'type'=>1],"");?>&type_info=' + price + '&platform=' + platform
        }
    });
</script>
</body>
</html>